package com.onlyphoto.onlymall.mvp.presenter

import android.content.Context
import com.onlyphoto.onlymall.base.BaseNetworkResponse
import com.onlyphoto.onlymall.base.BaseObserver

import com.onlyphoto.onlymall.mvp.contract.CLogistics
import com.onlyphoto.onlymall.mvp.model.MLogisticsImpl
import com.onlyphoto.onlymall.base.BasePresenter
import com.onlyphoto.onlymall.bean.response.LogisticsBean


class PLogisticsImpl(mContext: Context, mView: CLogistics.IVLogistics) : BasePresenter<CLogistics.IVLogistics, MLogisticsImpl>(mContext, mView, MLogisticsImpl()), CLogistics.IPLogistics {
    override fun getLogistics() {
        val bean = mView.setExpress()
        mModel.getLogistics(bean, object :BaseObserver<ArrayList<LogisticsBean>>(mContext.get()){
            override fun onSuccess(data: ArrayList<LogisticsBean>?, msg: String?) {
                mView.getLogisticsSuccess(data!!)
            }

            override fun onCodeError(t: BaseNetworkResponse<ArrayList<LogisticsBean>>?) {
            }

            override fun onFailure(e: Throwable?) {
            }

            override fun onRequestStart() {
            }

            override fun onFinally() {
            }

        })
    }
}
